package com.yu8home.mix;

import jakarta.annotation.PostConstruct;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class OrderT implements InitializingBean, ApplicationRunner, CommandLineRunner {

    @PostConstruct
    public void init() {
        System.out.println("执行顺序：PostConstruct");
    }


    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("执行顺序：InitializingBean");
    }

    @Override
    public void run(ApplicationArguments args) {
        System.out.println("执行顺序：ApplicationRunner");

    }

    @Override
    public void run(String... args) {
        System.out.println("执行顺序：CommandLineRunn");
    }

}
